<template>
    <div>
        <el-button type="primary">添加</el-button>
        <information-center :items="data"/>
                    <el-footer >
 <el-pagination
    layout="prev, pager, next"
     :page-count="data.sumpage"
            @current-change="handleCurrentChange">
  </el-pagination>
        </el-footer>
    </div>
</template>

<script>
import InformationCenter from '@/components/InformationCenter.vue'
    export default {
      data() {
        return {
          data:'',
            page:'1',
        }
      },
      mounted(){
       this.getData()
      },
         methods: {
         handleCurrentChange(val) {
        console.log(`当前页: ${val}`);
        this.page=val
        console.log(this.page)
        this.getData()
      },
        getData() {
          const url = `/zx_fy?pageSize=5&&curpage=${this.page}`;
    this.axios.get(url).then((res) => {
      this.data = res.data;
      console.log(res);
          })
        }
      },
  components: { InformationCenter },
        
    }
</script>

<style lang="scss" scoped>
.el-button {
    margin-bottom: 20px;
}
.el-footer {
  text-align: center;
  line-height: 60px;
    position: fixed;
    bottom: 30px;
    left: 40%;
    margin: 0 auto;
}
</style>